﻿@{
    ViewBag.Title = "用户组管理》表单页面";
    Layout = "~/Views/Shared/_LayoutForm.cshtml";
}
<script type="text/javascript">
    $(function () {
        InitControl();
    })
    //得到一个对象实体
    function InitControl() {
        if (!!GetQuery('KeyValue')) {
            getAjax("/CommonModule/GroupUser/SetForm", { KeyValue: GetQuery('KeyValue') }, function (data) {
                var data = eval("(" + data + ")");
                SetWebControls(data);
            });
        } else {
            //显示顺序
            AjaxJson("/CommonModule/GroupUser/SortCode", {}, function (Data) {
                $("#SortCode").val(Data);
            })
            $("#CompanyId").val(GetQuery('CompanyId'));
            $("#DepartmentId").val(GetQuery('DepartmentId'));
            $("#DepartmentName").val(GetQuery('DepartmentName'));
        }
    }
    //保存事件
    function AcceptClick() {
        if (!CheckDataValid('#form1')) {
            return false;
        }
        Loading(true, "正在提交数据...");
        window.setTimeout(function () {
            var postData = GetWebControls("#form1");
            AjaxJson("/CommonModule/GroupUser/SubmitForm?KeyValue=" + GetQuery('KeyValue'), postData, function (data) {
                tipDialog(data.Message, 3, data.Code);
                top.frames[tabiframeId()].windowload();
                closeDialog();
            });
        }, 200);
    }
</script>
<form id="form1" style="margin: 1px">
    <div id="message" style="display: none"></div>
    <table class="form">
        <tr>
            <th class="formTitle">组编码*</font>：
            </th>
            <td class="formValue">
                <input id="CompanyId" type="hidden" />
                <input id="DepartmentId" type="hidden" />
                <input id="Code" onblur="FieldExist(this.id,'Base_GroupUser','PostId','组编码')" type="text" class="txt required" datacol="yes" err="组编码" checkexpession="NotNull" />
            </td>
        </tr>
        <tr>
            <th class="formTitle">用户组：
            </th>
            <td class="formValue">
                <input id="FullName" type="text" class="txt required" datacol="yes" err="部门名称" checkexpession="NotNull" />
            </td>
        </tr>
        <tr>
            <th class="formTitle">显示顺序：</th>
            <td class="formValue">
                <input id="SortCode" type="text" onkeyup="IsNumber(this.id)" class="txt required" datacol="yes" err="显示顺序" checkexpession="Num" />
            </td>
        </tr>
        <tr>
            <th class="formTitle">选项：</th>
            <td class="formValue">
                <span class="item">
                    <input type="checkbox" name="checkbox" checked="checked" id="Enabled" />
                    <label for="Enabled">有效</label>
                </span>
            </td>
        </tr>
        <tr>
            <th class="formTitle">描述：
            </th>
            <td class="formValue">
                <textarea id="Remark" name="Description" maxlength="200" class="txtArea" rows="5"></textarea>
            </td>
        </tr>
    </table>
</form>
